/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package reciprocal;

/**
 *
 * @author Eagle
 */
public class mySum {
    static void sum (int slotIdx, boolean isGlu, int[] pairStack, int[] result)
    {

//      Result  [blank][oneGlu][twoGlu][oneGABA][twoGABA][onePlusOne]
        int pairIdx=slotIdx/2;

        if (isGlu)
        {
            switch (pairStack[pairIdx])
               {
                   case 0:
                       pairStack[pairIdx]+=1;
                       result[0]++;
                       break;
                   case 1:
                       pairStack[pairIdx]+=1;
                       result[0]--;
                       result[1]++;
                       break;
                   case 10:
                       pairStack[pairIdx]+=1;
                       result[2]--;
                       result[4]++;
                       break;
               }
        }
        else switch (pairStack[pairIdx])
               {
                   case 0:
                       pairStack[pairIdx]+=10;
                       result[2]++;
                       break;
                   case 1:
                       pairStack[pairIdx]+=10;
                       result[0]--;
                       result[4]++;
                       break;
                   case 10:
                       pairStack[pairIdx]+=10;
                       result[2]--;
                       result[3]++;
                       break;
               }

    }

}
